﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Model.Models.Empresa>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<h2><center>Lista de empresas<center/></h2>
<table>
    <tr>
       
        <th> Nome </th><th> Cnpj</th><th>Email</th><th> Senha</th>  <th>Telefone</th><th> Razao Social </th>
        <th> Cidade  </th>  <th> Estado  </th> <th>Opção</th>
    </tr>

<% foreach (var item in Model) { %>
    <tr>
        <td>
            <%: Html.DisplayFor(modelItem => item.Nome) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Cnpj) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Email) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Senha) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Telefone) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.RazaoSocial) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Cidade) %>
        </td>
        <td>
            <%: Html.DisplayFor(modelItem => item.Estado) %>
        </td>
        <td>
            <%: Html.ActionLink("Editar", "Edit", new {  id=item.Id_Empresa }) %> |
            <%: Html.ActionLink("Detalhes", "Details", new {  id=item.Id_Empresa }) %> |
            <%: Html.ActionLink("Deletar", "Delete", new {  id=item.Id_Empresa }) %>
        </td>
    </tr>
<% } %>
</table>
<p>
    <%: Html.ActionLink("Cadastrar empresa", "Create") %>
</p>
</asp:Content>
